class Solution(object):
    def sequentialDigits(self, low, high):
        now = [1, 2, 3, 4, 5, 6, 7, 8]
        out = []
        while now:
            next_list = []
            for num in now:
                if num >= low:
                    out.append(num)
                if num % 10 < 9:
                    num = 10 * num + num % 10 + 1
                    if num <= high:
                        next_list.append(num)
            now = next_list
        return out


